package com.iacrqq.sedaf.thread;

import com.iacrqq.sedaf.common.Controllable;
import com.iacrqq.sedaf.common.Destroyable;
import com.iacrqq.sedaf.common.Initializable;
import com.iacrqq.sedaf.common.Nameable;
import com.iacrqq.sedaf.profile.Profilable;

/**
 * 
 * @author sihai
 *
 */
public interface ThreadPool extends Nameable, Initializable, Destroyable, Controllable, Profilable {
	
	/**
	 * 
	 * @param runnable
	 */
	void setRunnable(Runnable runnable);
	
	/**
	 * 
	 * @param num
	 * @return
	 */
	int idle(int num);
	
	/**
	 * 
	 * @param num
	 */
	int addThreads(int num);
	
	/**
	 * 
	 * @return
	 */
	int removeIdleThreads();
	
	/**
	 * 目前只释放idle thread
	 * @param num
	 * @return
	 */
	int removeThreads(int num);
	
	/**
	 * 
	 * @return
	 */
	int idleSize();
}
